package main

import "fmt"

func (t test) demo() {
	fmt.Println(t.id)
}

func maopao(nums []int) []int {

	if len(nums) < 1 {
		return nums
	}
	for i := 0; i < len(nums)-1; i++ {
		for j := i + 1; j < len(nums); j++ {
			if nums[i] > nums[j] {
				nums[i], nums[j] = nums[j], nums[i]
			}
		}
	}
	return nums
}

type test struct {
	id int
}

func printMap(myMap map[int]*int) {
	for i, v := range myMap {
		fmt.Printf("map[%v]=%v\n", i, v)
	}
}

func main() {

	nums := []int{2, 16, 1, 9, 10, 8, 3, 5}
	fmt.Println(maopao(nums))
	return
	//slice := []int{1,2,3}
	//newMap := make(map[int]*int)
	//for i, v := range slice {
	//	newMap[i] = &v
	//}
	//printMap(newMap)

	//test := &test{id: 3}
	//test.demo()
	//test1 := &test
	//(*test1).demo()
	//return
	//nums := []int{2,16,1,9,10,8,3,5}
	//num := maopao(nums)
	//fmt.Println(num)
	//test := new(test)
	//fmt.Println(test.id)

	//arr := []int{1,4,5,6,20,40}
	//index := Erfen(arr, 40)
	//fmt.Println(index)
}
